package cn.tao.user.controller;

import cn.tao.user.service.IWxUserService;
import cn.tao.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/wxUser")
public class WxController {


    @Autowired
    private IWxUserService wxUserService;

    /**
     * 微信扫码登录
     * @param map
     * @return
     */
    @PostMapping("/wxlogin")
    public AjaxResult wxlogin(@RequestBody Map<String,String> map){
        return wxUserService.wxlogin(map);
    }

    /**
     * 绑定用户
     * @param map
     * @return
     */
    @PostMapping("/bind")
    public AjaxResult bind(@RequestBody Map<String,String> map){
        return wxUserService.bind(map);
    }
}
